﻿#define FAST_TEST
#undef  FAST_TEST

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Documents;

namespace FishingSearch
{
    public struct RodLimit
    {
        //BASS ROD
        const int _MIN_CASTING_BASS_ROD = 5;
        const int _MAX_CASTING_BASS_ROD = 22;
        const int _MIN_LENGTH_BASS_ROD = 180;
        const int _MAX_LENGTH_BASS_ROD = 240;

        public int MinCasting_BassRod
        { get { return _MIN_CASTING_BASS_ROD; } }
        public int MaxCasting_BassRod
        { get { return _MAX_CASTING_BASS_ROD; } }
        public int MinLength_BassRod
        { get { return _MIN_LENGTH_BASS_ROD; } }
        public int MaxLength_BassRod
        { get { return _MAX_LENGTH_BASS_ROD; } }

    
        //BLUEFISH
        const int _MIN_CASTING_BLUEFISH_ROD = 10;
        const int _MAX_CASTING_BLUEFISH_ROD = 86;
        const int _MIN_LENGTH_BLUEFISH_ROD = 200;
        const int _MAX_LENGTH_BLUEFISH_ROD = 275;

        public int MinCasting_BluefishRod
        { get { return _MIN_CASTING_BLUEFISH_ROD; } }
        public int MaxCasting_BluefishRod
        { get { return _MAX_CASTING_BLUEFISH_ROD; } }
        public int MinLength_BluefishRod
        { get { return _MIN_LENGTH_BLUEFISH_ROD; } }
        public int MaxLength_BluefishRod
        { get { return _MAX_LENGTH_BLUEFISH_ROD; } }


        //BOAT ROD
        const int _MIN_CASTING_BOAT_ROD = 20;
        const int _MAX_CASTING_BOAT_ROD = 170;
        const int _MIN_LENGTH_BOAT_ROD = 200;
        const int _MAX_LENGTH_BOAT_ROD = 275;

        public int MinCasting_BoatRod
        { get { return _MIN_CASTING_BOAT_ROD; } }
        public int MaxCasting_BoatRod
        { get { return _MAX_CASTING_BOAT_ROD; } }
        public int MinLength_BoatRod
        { get { return _MIN_LENGTH_BOAT_ROD; } }
        public int MaxLength_BoatRod
        { get { return _MAX_LENGTH_BOAT_ROD; } }

    }

    public class BassRodLimit
    {
        RodLimit bassRodLimit;

        public const bool _ACTION_FAST = true;
        public const bool _ACTION_EXTRA_FAST = true;
        public const bool _POWER_MEDIUM = true;
        public const bool _POWER_MEDIUM_HEAVY = true;
        public const string _BRAND = "";

        public BassRodLimit()
        {
            _minCasting = bassRodLimit.MinCasting_BassRod;
            _maxCasting = bassRodLimit.MaxCasting_BassRod;
            _minLength = bassRodLimit.MinLength_BassRod;
            _maxLength = bassRodLimit.MaxLength_BassRod;
            _actionFast = _ACTION_FAST;
            _actionExtraFast = _ACTION_EXTRA_FAST;
            _powerMedium = _POWER_MEDIUM;
            _powerMedHeavy = _POWER_MEDIUM_HEAVY;

            _brand = _BRAND;
        }

        private int _minCasting;
        public int MinCasting
        {
            set { _minCasting = value; }
            get { return _minCasting; }
        }

        private int _maxCasting;
        public int MaxCasting
        {
            set { _maxCasting = value; }
            get { return _maxCasting; }
        }

        private int _minLength;
        public int MinLength
        {
            set { _minLength = value; }
            get { return _minLength; }
        }

        private int _maxLength;
        public int MaxLength
        {
            set { _maxLength = value; }
            get { return _maxLength; }
        }

        private bool? _actionFast;
        public bool? ActionFast
        {
            set { _actionFast = value; }
            get { return _actionFast; }
        }

        private bool? _actionExtraFast;
        public bool? ActionExtraFast
        {
            set { _actionExtraFast = value; }
            get { return _actionExtraFast; }
        }

        private bool? _powerMedium;
        public bool? PowerMedium
        {
            set { _powerMedium = value; }
            get { return _powerMedium; }
        }

        private bool? _powerMedHeavy;
        public bool? PowerMedHeavy
        {
            set { _powerMedHeavy = value; }
            get { return _powerMedHeavy; }
        }
        private string _brand;
        public string Brand
        {
            set { _brand = value; }
            get { return _brand; }
        }

    }

    public class BluefishRodLimit
    {
        RodLimit bluefishLimit;

        public const bool _ACTION_FAST = true;
        public const bool _ACTION_MOD_FAST = true;
        public const bool _ACTION_MODERATE = true;
        public const bool _POWER_HEAVY = true;
        public const bool _POWER_MOD_HEAVY = true;
        public const bool _POWER_EXTRA_HEAVY = true;
        public const string _BRAND = "";

        public BluefishRodLimit()
        {
            _minCasting = bluefishLimit.MinCasting_BluefishRod;
            _maxCasting = bluefishLimit.MaxCasting_BluefishRod;
            _minLength = bluefishLimit.MinLength_BluefishRod;
            _maxLength = bluefishLimit.MaxLength_BluefishRod;

            _actionFast = _ACTION_FAST;
            _actionModFast = _ACTION_MOD_FAST;
            _actionModerate = _ACTION_MODERATE;
            _powerHeavy = _POWER_HEAVY;
            _powerModHeavy = _POWER_MOD_HEAVY;
            _powerExtraHeavy = _POWER_EXTRA_HEAVY;

            _brand = _BRAND;
        }

        private int _minCasting;
        public int MinCasting
        {
            set { _minCasting = value; }
            get { return _minCasting; }
        }

        private int _maxCasting;
        public int MaxCasting
        {
            set { _maxCasting = value; }
            get { return _maxCasting; }
        }

        private int _minLength;
        public int MinLength
        {
            set { _minLength = value; }
            get { return _minLength; }
        }

        private int _maxLength;
        public int MaxLength
        {
            set { _maxLength = value; }
            get { return _maxLength; }
        }

        private bool? _actionFast;
        public bool? ActionFast
        {
            set { _actionFast = value; }
            get { return _actionFast; }
        }

        private bool? _actionModFast;
        public bool? ActionModFast
        {
            set { _actionModFast = value; }
            get { return _actionModFast; }
        }
        private bool? _actionModerate;
        public bool? ActionModerate
        {
            set { _actionModerate = value; }
            get { return _actionModerate; }
        }

        private bool? _powerHeavy;
        public bool? PowerHeavy
        {
            set { _powerHeavy = value; }
            get { return _powerHeavy; }
        }

        private bool? _powerModHeavy;
        public bool? PowerModHeavy
        {
            set { _powerModHeavy = value; }
            get { return _powerModHeavy; }
        }
        private bool? _powerExtraHeavy;
        public bool? PowerExtraHeavy
        {
            set { _powerExtraHeavy = value; }
            get { return _powerExtraHeavy; }
        }
        private string _brand;
        public string Brand
        {
            set { _brand = value; }
            get { return _brand; }
        }
    }
  
    public class BoatRodLimit
    {
        RodLimit boatRodLimit;
        public const bool _ACTION_MODERATE = true;
        public const bool _POWER_HEAVY = true;
        public const bool _POWER_EXTRA_HEAVY = true;
        public const string _BRAND = "";


        public BoatRodLimit()
        {
            _minCasting = boatRodLimit.MinCasting_BoatRod;
            _maxCasting = boatRodLimit.MaxCasting_BoatRod;
            _minLength = boatRodLimit.MinLength_BoatRod;
            _maxLength = boatRodLimit.MaxLength_BoatRod;

            _actionModerate = _ACTION_MODERATE;
            _powerHeavy = _POWER_HEAVY;
            _powerExtraHeavy = _POWER_EXTRA_HEAVY;

            _brand = _BRAND;
        }

        private int _minCasting;
        public int MinCasting
        {
            set { _minCasting = value; }
            get { return _minCasting; }
        }

        private int _maxCasting;
        public int MaxCasting
        {
            set { _maxCasting = value; }
            get { return _maxCasting; }
        }

        private int _minLength;
        public int MinLength
        {
            set { _minLength = value; }
            get { return _minLength; }
        }

        private int _maxLength;
        public int MaxLength
        {
            set { _maxLength = value; }
            get { return _maxLength; }
        }

        private bool? _actionModerate;
        public bool? ActionModerate
        {
            set { _actionModerate = value; }
            get { return _actionModerate; }
        }

        private bool? _powerHeavy;
        public bool? PowerHeavy
        {
            set { _powerHeavy = value; }
            get { return _powerHeavy; }
        }

        private bool? _powerExtraHeavy;
        public bool? PowerExtraHeavy
        {
            set { _powerExtraHeavy = value; }
            get { return _powerExtraHeavy; }
        }

        private string _brand;
        public string Brand
        {
            set { _brand = value; }
            get { return _brand; }
        }

    }

    public class Rods
    {
        #region field
        //public Info info;
        public string Codice { get; set; }
        public string Marca { get; set; }
        public string Modello { get; set; }
        public string Pezzi { get; set; }
        public string Lunghezza { get; set; }
        public string Casting { get; set; }
        public string Anelli { get; set; }
        public string Peso { get; set; }
        public string Azione { get; set; }
        public string Potenza { get; set; }
        //public double Prezzo { get; set; }
        public string Prezzo { get; set; }
        public Uri Link { get; set; }
        #endregion field

        public Rods(string codice, string marca, string modello, string pezzi, string lunghezza, string casting, string azione, string anelli, string peso, string potenza, string prezzo, Uri link)
        //public CanneLaMincio(Info info)
        {
            //this.info.Codice = info.Codice;
            //this.info.Modello = info.Modello;
            //this.info.Pezzi = info.Pezzi;
            //this.info.Lunghezza = info.Lunghezza;
            //this.info.Casting = info.Casting;
            //this.info.Anelli = info.Anelli;
            //this.info.Peso = info.Peso;
            //this.info.Azione = info.Azione;
            //this.info.Prezzo = info.Prezzo;
            //this.info.Link = info.Link;
            this.Codice = codice;
            this.Marca = marca;
            this.Modello = modello;
            this.Pezzi = pezzi;
            this.Lunghezza = lunghezza;
            this.Casting = casting;
            this.Anelli = anelli;
            this.Peso = peso;
            this.Azione = azione;
            this.Potenza = potenza;
            this.Prezzo = prezzo;
            this.Link = link;
        }

        public Rods()
            : this("unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", null)
        {
        }

        public List<string> LoadAllLinks()
        {
            string staticUrl;
            var stringListAll = new List<string>();

#if !FAST_TEST
            //LA MINCIO
            staticUrl = "http://www.lamincio.com/nqcontent.cfm?a_id=";
            //ABU GARCIA
            stringListAll.Add(staticUrl + "5602");
            stringListAll.Add(staticUrl + "5603");
            //ALCEDO
            stringListAll.Add(staticUrl + "7163");
            stringListAll.Add(staticUrl + "7187");
            stringListAll.Add(staticUrl + "4350");
            stringListAll.Add(staticUrl + "7143");
            stringListAll.Add(staticUrl + "7144");
            stringListAll.Add(staticUrl + "7145");
            //BERKLEY
            stringListAll.Add(staticUrl + "9471");
            stringListAll.Add(staticUrl + "9470");
            stringListAll.Add(staticUrl + "7217");
            //DAIWA
            stringListAll.Add(staticUrl + "5152");
            stringListAll.Add(staticUrl + "9568");
            stringListAll.Add(staticUrl + "8317");
            stringListAll.Add(staticUrl + "8318");
            stringListAll.Add(staticUrl + "8398");
            //FOX
            stringListAll.Add(staticUrl + "4503");
            //FOX RAGE
            stringListAll.Add(staticUrl + "8539");
            stringListAll.Add(staticUrl + "8540");
            stringListAll.Add(staticUrl + "8541");
            stringListAll.Add(staticUrl + "8542");
            stringListAll.Add(staticUrl + "8543");
            stringListAll.Add(staticUrl + "8544");
            stringListAll.Add(staticUrl + "8553");
            stringListAll.Add(staticUrl + "8554");
            //G-LOOMIS OUTLET
            stringListAll.Add(staticUrl + "9502");
            //G-LOOMIS
            stringListAll.Add(staticUrl + "9511");
            stringListAll.Add(staticUrl + "9513");
            stringListAll.Add(staticUrl + "9512");
            stringListAll.Add(staticUrl + "9514");
            stringListAll.Add(staticUrl + "9518");
            stringListAll.Add(staticUrl + "6963");
            stringListAll.Add(staticUrl + "5239");
            stringListAll.Add(staticUrl + "5242");
            stringListAll.Add(staticUrl + "5243");
            stringListAll.Add(staticUrl + "5245");
            stringListAll.Add(staticUrl + "5263");
            stringListAll.Add(staticUrl + "5301");
            stringListAll.Add(staticUrl + "5303");
            stringListAll.Add(staticUrl + "5305");
            stringListAll.Add(staticUrl + "5306");
            stringListAll.Add(staticUrl + "5419");
            //MAJOR CRAFT
            stringListAll.Add(staticUrl + "8442");
            stringListAll.Add(staticUrl + "7590");
            stringListAll.Add(staticUrl + "8443");
            stringListAll.Add(staticUrl + "7763");
            stringListAll.Add(staticUrl + "7764");
            //MITCHELL
            stringListAll.Add(staticUrl + "9564");
            //PEZON E MICHEL
            stringListAll.Add(staticUrl + "2104");
            //SAVAGE GEAR
            stringListAll.Add(staticUrl + "7771");
            stringListAll.Add(staticUrl + "5891");
            stringListAll.Add(staticUrl + "8955");
            //SHIMANO
            stringListAll.Add(staticUrl + "9296");
            stringListAll.Add(staticUrl + "5492");
            stringListAll.Add(staticUrl + "7949");
            stringListAll.Add(staticUrl + "5501");
            stringListAll.Add(staticUrl + "6990");
            stringListAll.Add(staticUrl + "5494");
            stringListAll.Add(staticUrl + "6987");
            stringListAll.Add(staticUrl + "9314");
            stringListAll.Add(staticUrl + "9112");
            stringListAll.Add(staticUrl + "9111");
            stringListAll.Add(staticUrl + "7951");
            stringListAll.Add(staticUrl + "7952");
            stringListAll.Add(staticUrl + "7958");
            stringListAll.Add(staticUrl + "5495");
            stringListAll.Add(staticUrl + "6988");
            stringListAll.Add(staticUrl + "6989");
            stringListAll.Add(staticUrl + "7959");
            stringListAll.Add(staticUrl + "5500");
            //SHIMANO YASEI
            stringListAll.Add(staticUrl + "9108");
            stringListAll.Add(staticUrl + "9109");
            stringListAll.Add(staticUrl + "9297");
            //ST CROIX
            stringListAll.Add(staticUrl + "9299");
            stringListAll.Add(staticUrl + "7297");
            stringListAll.Add(staticUrl + "9142");
            stringListAll.Add(staticUrl + "7021");
            stringListAll.Add(staticUrl + "7928");
            stringListAll.Add(staticUrl + "7019");
            stringListAll.Add(staticUrl + "9794");
            stringListAll.Add(staticUrl + "7830");
            stringListAll.Add(staticUrl + "9796");
            stringListAll.Add(staticUrl + "9797");
            stringListAll.Add(staticUrl + "7022");
            stringListAll.Add(staticUrl + "7298");
            stringListAll.Add(staticUrl + "7926");
            stringListAll.Add(staticUrl + "7020");
            stringListAll.Add(staticUrl + "7827");
            stringListAll.Add(staticUrl + "7015");
            stringListAll.Add(staticUrl + "7081");
            stringListAll.Add(staticUrl + "7142");
            stringListAll.Add(staticUrl + "7023");
            stringListAll.Add(staticUrl + "8989");
            stringListAll.Add(staticUrl + "9786");
            stringListAll.Add(staticUrl + "9785");

            //LAMIGLAS
            staticUrl = "http://www.lamiglas.com/prod_indiv.php?groupid=";
            stringListAll.Add(staticUrl + "53");
            //SALTWATER RODS: BLACK SALT
            stringListAll.Add(staticUrl + "79");
            //SALTWATER RODS: BIG FISH
            stringListAll.Add(staticUrl + "32");
            //SALTWATER RODS: EXCEL INSHORE
            stringListAll.Add(staticUrl + "69");
            //SALTWATER RODS: TRI-FLEX GRAPHITE SALTWATER
            stringListAll.Add(staticUrl + "30");

            //FALCONRODSITALY
            staticUrl = "http://www.falconrodsitaly.com/";
            stringListAll.Add(staticUrl + "falcon_cara_t7.php");
            stringListAll.Add(staticUrl + "falcon_bucoo.php");
            stringListAll.Add(staticUrl + "falcon_lowrider.php");
            stringListAll.Add(staticUrl + "falcon_original.php");
            stringListAll.Add(staticUrl + "falcon_hd.php");


            //GAMEIFISH
            staticUrl = "http://www.gamefish.it/index.php?page=shop.product_details&flypage=flypage.tpl&product_id=";
            // ST. CROIX AVID INSHORE 
            stringListAll.Add(staticUrl + "4328&category_id=530&option=com_virtuemart&Itemid=254");
            stringListAll.Add(staticUrl + "4329&category_id=530&option=com_virtuemart&Itemid=254");
            stringListAll.Add(staticUrl + "4330&category_id=530&option=com_virtuemart&Itemid=254");
            stringListAll.Add(staticUrl + "6000&category_id=530&option=com_virtuemart&Itemid=254");
            stringListAll.Add(staticUrl + "4332&category_id=530&option=com_virtuemart&Itemid=254");
            //ST. CROIX TIDEMASTER INSHORE 
            stringListAll.Add(staticUrl + "7505&category_id=531&option=com_virtuemart&Itemid=254");
            stringListAll.Add(staticUrl + "7796&category_id=531&option=com_virtuemart&Itemid=254");
            stringListAll.Add(staticUrl + "7504&category_id=531&option=com_virtuemart&Itemid=254");
            stringListAll.Add(staticUrl + "7509&category_id=531&option=com_virtuemart&Itemid=254");
            // ST. CROIX MOJO INSHORE 
            stringListAll.Add(staticUrl + "7795&category_id=555&option=com_virtuemart&Itemid=254");
            stringListAll.Add(staticUrl + "7794&category_id=555&option=com_virtuemart&Itemid=254");
#endif

            //FISHERLANDIA
            staticUrl = "http://www.fisherlandia.it/";
            stringListAll.Add(staticUrl + "catalogo.php?id=classepro2&rid=catalogo&cat=2&tip=17&id_clp=1126&mar=1&catalog=0");
            stringListAll.Add(staticUrl + "catalogo.php?id=classepro2&rid=catalogo&cat=2&tip=17&id_clp=552&mar=1&catalog=0");
            stringListAll.Add(staticUrl + "catalogo.php?id=classepro2&rid=catalogo&cat=2&tip=17&id_clp=836&mar=1&catalog=0");
            stringListAll.Add(staticUrl + "catalogo.php?id=classepro2&rid=catalogo&cat=2&tip=17&id_clp=962&mar=1&catalog=0");
            stringListAll.Add(staticUrl + "catalogo.php?id=classepro2&rid=catalogo&cat=2&tip=17&id_clp=125&mar=1&catalog=0");
            stringListAll.Add(staticUrl + "catalogo.php?id=classepro2&rid=catalogo&cat=2&tip=17&id_clp=850&mar=1&catalog=0");
            stringListAll.Add(staticUrl + "catalogo.php?id=classepro2&rid=catalogo&cat=2&tip=17&id_clp=829&mar=1&catalog=0");
            stringListAll.Add(staticUrl + "catalogo.php?id=classepro2&rid=catalogo&cat=2&tip=17&id_clp=937&mar=1&catalog=0");
            stringListAll.Add(staticUrl + "catalogo.php?id=classepro2&rid=catalogo&cat=2&tip=17&id_clp=126&mar=1&catalog=0");
            stringListAll.Add(staticUrl + "catalogo.php?id=classepro2&rid=catalogo&cat=2&tip=17&id_clp=130&mar=1&catalog=0");
            stringListAll.Add(staticUrl + "catalogo.php?id=classepro2&rid=catalogo&cat=2&tip=17&id_clp=956&mar=1&catalog=0");
            stringListAll.Add(staticUrl + "catalogo.php?id=classepro2&rid=catalogo&cat=2&tip=17&id_clp=833&mar=1&catalog=0");
            stringListAll.Add(staticUrl + "catalogo.php?id=classepro2&rid=catalogo&cat=2&tip=17&id_clp=959&mar=1&catalog=0");
            stringListAll.Add(staticUrl + "catalogo.php?id=classepro2&rid=catalogo&cat=2&tip=17&id_clp=123&mar=1&catalog=0");
            stringListAll.Add(staticUrl + "catalogo.php?id=classepro2&rid=catalogo&cat=2&tip=17&id_clp=960&mar=1&catalog=0");
            stringListAll.Add(staticUrl + "catalogo.php?id=classepro2&rid=catalogo&cat=2&tip=17&id_clp=831&mar=1&catalog=0");

            staticUrl = "http://www.gloomis.com/";
            stringListAll.Add(staticUrl + "publish/content/gloomis_2010/eu/en/conventional/rods/classic_bass_rods/classic_spin_jig.html");
            stringListAll.Add(staticUrl + "publish/content/gloomis_2010/eu/en/conventional/rods/saltwater_rods/pro-green.html");
            //var timeElapsed = time.ElapsedMilliseconds;
            //MessageBox.Show("LoadAllHref -- elapsed:" + timeElapsed.ToString());
            return stringListAll;
        }

        public void Clear()
        {
            this.Codice = "";
            this.Marca = "";
            this.Modello = "";
            this.Pezzi = "";
            this.Lunghezza = "";
            this.Casting = "";
            this.Anelli = "";
            this.Peso = "";
            this.Azione = "";
            this.Potenza = "";
            this.Prezzo = "";
            this.Link = null;
        }

        public override string ToString()
        {
            return Codice + " | " + Modello;
        }

    }
}
